#include <string>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>


using namespace std;

int main(int argc, char *argv[]) 
{
    if (argc < 2) {
        return 0;
    }


    FILE *fp = fopen(argv[1], "r");  
    if (fp == NULL) {  
        perror("Open file recfile");  
        exit(1);  
    }  
    char buf[2] = { 0 };

    std::string temp = "";
    while (fgets(buf, 2, fp)) {
        if (buf[0] == 0) {
            continue;
        }
        if ('[' == buf[0]) {
            printf("%s\n", temp.c_str());
            temp = "";
        }
        temp.append(buf);
    }
    printf("%s\n", temp.c_str());

    fclose(fp);  
    return 0; 
}
